class UsersController < ApplicationController
  before_filter :authenticate_user!
  before_filter :admin_required
  respond_to :html, :json

  def index
    @users = User.all
  end
   
  def destroy
    user = User.find(params[:id])
    unless user == current_user
      user.destroy
      redirect_to users_path, :notice => "User deleted."
    else
      redirect_to users_path, :notice => "Can't delete yourself."
    end
  end
end

